{include file="common/header"}
<link href="/static/admin/css/other.css" rel="stylesheet">
<main class="lyear-layout-content">
    <div class="container-fluid">
        <div class="row ant-menu-submenu">
            <div class="col-lg-10 col-b90">
                <div class="card right-card">
                    <div class="right-card-header card-header">
                        <h4>{:lang('user.service_group')}</h4>
                    </div>
                    <div class="card-toolbar clearfix">
                        <div class="toolbar-btn-action">
                            <button class="btn btn-label btn-default" data-toggle="modal" data-target=".add_service_group">
                                <label>
                                    <i class="iconfont icon-plus-line"></i>
                                </label>{:lang('user.add_group')}
                            </button>
                        </div>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th width="75%">{:lang('chats.group_name')}</th>
                                        <th width="20%">{:lang('public.operation')}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                {foreach $group_lists as $item}
                                    <tr id="group_lists">
                                        <td class="hide data-source-{$item['id']}" data='{
                                            "edit":{"id":"{$item['id']}","url":"{:adminUrl('admin/Set/set_edit_service_group')}"},
                                            "del":{"id":"{$item['id']}","url":"{:adminUrl('admin/Set/set_del_service_group')}"}
                                        }'></td>
                                        <td id="name" valid="{$item['id']}">{$item['name']}</td>
                                        <td>
                                            <div class="btn-group">
                                                <a class="btn btn-xs btn-success" id="editdata" valid="{$item['id']}">
                                                    <i class="iconfont icon-xiugai"></i>
                                                </a>
                                                <a class="btn btn-xs btn-success" id="deldata" valid="{$item['id']}">
                                                    <i class="iconfont icon-shanchu"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                        {$group_lists->render()|raw}
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<div class="modal fade add_service_group" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myLargeModalLabel">{:lang('user.add_group')}</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="group-name" class="control-label">{:lang('public.name')}</label>
                    <input type="text" class="form-control" id="group-name">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">{:lang('public.close')}</button>
                <button type="button" class="btn btn-primary" id="add-service-group">{:lang('public.save')}</button>
            </div>
        </div>
    </div>
</div>
{include file="common/footer"}
<script type="text/javascript">
    let IM_config = {
        addServiceGroup: "{:adminUrl('admin/Set/set_service_group')}"
    };
</script>
<script type="text/javascript" src="/static/admin/js/set.js"></script>